﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

[Serializable]
public class AppleServiceEntity
{
    public string DeviceName {get; set;}
    public string StoreLocation { get; set; }
     
}

public class DropdownListDataSource
{
    public List<string> Names { get; set; }

    public List<string> Select()
    {
        return Names;
    }
}

[Serializable]
public class AppleService : ServiceBase
{
    public const int ItemPrice = 2;

	public AppleService()
	{
        this.entities = new List<AppleServiceEntity>();
        //this.entities.Add(new AppleSerivceEntity() { DeviceName = "IPAD", StoreLocation="中国香港" });
	}

    private List<AppleServiceEntity> entities;

    public List<AppleServiceEntity> Entities
    {
        get
        {
            return this.entities;
        }
        set
        {
            this.entities = value;
        }
    }

    public List<AppleServiceEntity> Select()
    {
        return this.entities;
    }

    public void Update(int ListIndex, string DeviceName, string StoreLocation)
    {
        entities[ListIndex].DeviceName = DeviceName;
        entities[ListIndex].StoreLocation = StoreLocation;
    }

    public void Delete(int ListIndex)
    {
        this.entities.RemoveAt(ListIndex);
    }
}